<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台首页</title>
    <link rel="stylesheet" href="/php/tpblog/public/BootStrap/css/bootstrap.min.css" />
    <link rel="stylesheet" href="/php/tpblog/public/BootStrap/css/bootstrap-rtl.css" />
    <script type="text/javascript" src="/php/tpblog/public/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="/php/tpblog/public/BootStrap/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/php/tpblog/public/js/layer.js"></script>
</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">بىلوگ سېستىىسى </a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li <?php if(CONTROLLER_NAME == 'Index'): ?>class="active"<?php endif; ?>><a href="<?php echo U('Index/index');?>">باشبەت <span class="sr-only">(current)</span></a></li>
                <li <?php if(CONTROLLER_NAME == 'Category'): ?>class="active"<?php endif; ?>><a href="<?php echo U('Category/index');?>">مەزمۇن</a></li>
                <li <?php if(CONTROLLER_NAME == 'User'): ?>class="active"<?php endif; ?>><a href="<?php echo U('User/index');?>">باشقۇرغۇچىلار</a></li>
                <li <?php if(CONTROLLER_NAME == 'Navs'): ?>class="active"<?php endif; ?>><a href="<?php echo U('Navs/index');?>">ئىقتىدار</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <li><a href="/php/tpblog/index.php" target="_blank">ئالدى بەت</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">ياخشىمۇسىز <?php echo ($sessions['auser']); ?><span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <?php $a_aid=$sessions['aid'] ?>
                         <li><a href="<?php echo U('User/edit',array('aid'=>$a_aid));?>">ئارخىب تەھرىرلەش</a></li>
                        <li><a href="<?php echo U('Index/logout');?>">بىخەتەر چېكىنىش </a></li>
                    </ul>
                </li>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<script src="/php/tpblog/public/uploadifile/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="/php/tpblog/public/uploadifile/uploadify.css"/>
<div class="container">
    <div class="row">
        <div style="height: 30px"></div>
        <div class="col-md-2">
            <ul class="list-group">
    <li class="list-group-item <?php if(CONTROLLER_NAME == 'Category'): ?>active<?php endif; ?>"><a href="<?php echo U('Category/index');?>">سەھىپە باشقۇرۇش</a></li>
    <li class="list-group-item <?php if(CONTROLLER_NAME == 'Tag'): ?>active<?php endif; ?>"><a href="<?php echo U('Tag/index');?>">خەتكۈچ باشقۇرۇش</a></li>
    <li class="list-group-item <?php if(CONTROLLER_NAME == 'Article'): ?>active<?php endif; ?>"><a href="<?php echo U('Article/index');?>">خەۋەر باشقۇرۇش</a></li>
</ul>
<style>
    .list-group .active a{
        color: #fff;
    }
</style>

        </div>
        <div class="col-md-10">
            <div class="page-header">
                <h4><?php echo ($page_title); ?></h4>
            </div>
            <div class="btn-group" role="group" aria-label="...">
                <a  href="<?php echo U('Article/index');?>" type="button" class="btn btn-default">بارلىق خەۋەرلەر</a>
            </div>
            <br><br>
            <form action="<?php echo U('Article/addhend');?>" method="post">
                <div class="row">
                <div class="col-md-8">
                        <div class="form-group">
                            <select class="form-control" name="category_cid">
                                <option value="">تۈر تاللاڭ</option>
                                <?php if(is_array($categorys)): foreach($categorys as $key=>$c): ?><option value="<?php echo ($c['cid']); ?>"><?php if($c['pid'] != 0): echo str_repeat('&nbsp;',$c['level']*10);?>┘─&nbsp;<?php endif; ?> <?php echo ($c['cname']); ?></option><?php endforeach; endif; ?>
                            </select>
                        </div>
                        <div class="form-group">
                            <input name="title" type="text" class="form-control" placeholder="يازما نامى">
                        </div>
                        <div class="form-group">
                            <textarea name="summer" class="form-control" rows="4" placeholder="ئۈزۈندە:"></textarea>
                        </div>
                        <div class="form-group">
                            
<script type="text/javascript" charset="utf-8" src="/php/tpblog/public/ueditor-1.4.3.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/php/tpblog/public/ueditor-1.4.3.3/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/php/tpblog/public/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>

<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('content', {
        toolbars: [
            [

                'undo', //撤销
                'redo', //重做
                'bold', //加粗
                'indent', //首行缩进
                'snapscreen', //截图
                'italic', //斜体
                'underline', //下划线
                'strikethrough', //删除线
                'subscript', //下标
                'fontborder', //字符边框
                'superscript', //上标
                'formatmatch', //格式刷
                'source', //源代码
                'blockquote', //引用
                'pasteplain', //纯文本粘贴模式
                'selectall', //全选
                'print', //打印
                'preview', //预览
                'horizontal', //分隔线
                'removeformat', //清除格式
                'time', //时间
                'date', //日期
                'unlink', //取消链接
                'insertrow', //前插入行
                'insertcol', //前插入列
                'mergeright', //右合并单元格
                'mergedown', //下合并单元格
                'deleterow', //删除行
                'deletecol', //删除列
                'splittorows', //拆分成行
                'splittocols', //拆分成列
                'splittocells', //完全拆分单元格
                'deletecaption', //删除表格标题
                'inserttitle', //插入标题
                'mergecells', //合并多个单元格
                'deletetable', //删除表格
                'cleardoc', //清空文档
                'insertparagraphbeforetable', //"表格前插入行"
                'insertcode', //代码语言
                'fontfamily', //字体
                'fontsize', //字号
                'paragraph', //段落格式
                'simpleupload', //单图上传
                'insertimage', //多图上传
                'edittable', //表格属性
                'edittd', //单元格属性
                'link', //超链接
                'emotion', //表情
                'spechars', //特殊字符
                'searchreplace', //查询替换
                'map', //Baidu地图
                'gmap', //Google地图
                'insertvideo', //视频
                'help', //帮助
                'justifyleft', //居左对齐
                'justifyright', //居右对齐
                'justifycenter', //居中对齐
                'justifyjustify', //两端对齐
                'forecolor', //字体颜色
                'backcolor', //背景色
                'insertorderedlist', //有序列表
                'insertunorderedlist', //无序列表
                'fullscreen', //全屏
                'directionalityltr', //从左向右输入
                'directionalityrtl', //从右向左输入
                'rowspacingtop', //段前距
                'rowspacingbottom', //段后距
                'pagebreak', //分页
                'insertframe', //插入Iframe
                'imagenone', //默认
                'imageleft', //左浮动
                'imageright', //右浮动
                'attachment', //附件
                'imagecenter', //居中
                'wordimage', //图片转存
                'lineheight', //行间距
                'edittip ', //编辑提示
                'customstyle', //自定义标题
                'autotypeset', //自动排版
                'webapp', //百度应用
                'touppercase', //字母大写
                'tolowercase', //字母小写
                'background', //背景
                'template', //模板
                'scrawl', //涂鸦
                'music', //音乐
                'inserttable', //插入表格
                'drafts', // 从草稿箱加载
                'charts', // 图表
            ]
        ],
        autoHeightEnabled: true,
        autoFloatEnabled: true
    });
</script>
                            <textarea type="text/plain" style="min-height: 350px" id="content" name="content"></textarea>
                        </div>
                    <div class="form-group">
                        <input name="asort" type="number" class="form-control" placeholder="تەرتىپ">
                    </div>
                        <div class="form-group">
                            <label class="radio-inline">
                                <input type="radio" name="status" id="inlineRadio1" value="1" checked> ئوچۇق
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" id="inlineRadio2" value="0"> تاقاق
                            </label>
                        </div>
                        <div class="form-group">
                            <input name="author" type="text" class="form-control" placeholder="ئاپتور">
                        </div>
                        <button type="submit" class="btn btn-primary">يوللاش</button>
                </div>
                <div class="col-md-4">
                    <div class="panel panel-default">
                        <div class="panel-heading">يازما مۇقاۋا رەسىمى</div>
                        <div class="panel-body">
                            <form>
                                <input id="thumbin" name="thumb" class="form-control "/>
                                <br>
                                <input type="file" name="upload"  id="file"  />
                                <img src="" id="thumbimg" />
                            </form>
                            <script type="text/javascript">
                                $(function() {
                                    $('#file').uploadify({
                                        'swf'      : '/php/tpblog/public/uploadifile/uploadify.swf',
                                        'uploader' : "<?php echo U('Article/uploadThumb');?>",
                                        'buttonText':'مۇقاۋا رەسىمى تاللاڭ',
                                        'onUploadSuccess':function (file,data) {
                                            data=$.parseJSON(data);
                                            $('#thumbin').val(data);
                                            $('#thumbimg').attr('src','../../../'+data);
                                        }
                                    });
                                });
                            </script>
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title">يازما تەۋسىيەلەش</h3>
                        </div>
                        <div class="panel-body">
                            <?php if(is_array($tags)): foreach($tags as $key=>$t): ?><label style="margin-right: 0" class="checkbox-inline">
                                 <input type="checkbox" name="tag[]"  value="<?php echo ($t['tid']); ?>"><?php echo ($t['tname']); ?>
                               </label><?php endforeach; endif; ?>
                        </div>
                    </div>
               </div>
         </div>
            </form>
        </div>
    </div>
</div>
<div style="height: 400px"></div>

</body>
</html>